// 配置和共享数据
const Config = (function() {
  // 行业数据
  const industryData = {
    2019: [200, 300, 300, 900, 1500, 1200, 600],
    2020: [300, 400, 350, 800, 1800, 1400, 700]
  };

  // 月度数据
  const monthlyData = {
    fans: [24, 40, 101, 134, 90, 230, 210, 230, 120, 230, 210, 120],
    visitors: [40, 64, 191, 324, 290, 330, 310, 213, 180, 200, 180, 79]
  };

  // 年龄分布数据
  const ageData = [
    { value: 1, name: "0岁以下" },
    { value: 4, name: "20-29岁" },
    { value: 2, name: "30-39岁" },
    { value: 2, name: "40-49岁" },
    { value: 1, name: "50岁以上" }
  ];

  // 学习进度数据
  const learningData = {
    percentages: [70, 34, 60, 78, 69],
    titles: ["HTML5", "CSS3", "javascript", "VUE", "NODE"],
    values: [702, 350, 610, 793, 664]
  };

  // 播放和转发数据
  const mediaData = {
    plays: [
      30, 40, 30, 40, 30, 40, 30, 60, 20, 40, 20, 40, 30, 40, 30, 40,
      30, 40, 30, 60, 20, 40, 20, 40, 30, 60, 20, 40, 20, 40
    ],
    forwards: [
      50, 30, 50, 60, 10, 50, 30, 50, 60, 40, 60, 40, 80, 30, 50, 60,
      10, 50, 30, 70, 20, 50, 10, 40, 50, 30, 70, 20, 50, 10, 40
    ]
  };

  // 地区分布数据
  const regionData = [
    { value: 20, name: "云南" },
    { value: 26, name: "北京" },
    { value: 24, name: "山东" },
    { value: 25, name: "河北" },
    { value: 20, name: "江苏" },
    { value: 25, name: "浙江" },
    { value: 30, name: "深圳" },
    { value: 42, name: "广东" }
  ];

  // 主题颜色
  const colors = {
    bar: ["#2f89cf"],
    line: ["#00f2f1", "#ed3f35"],
    pie: [
      "#065aab", "#066eab", "#0682ab", "#0696ab", "#06a0ab",
      "#06b4ab", "#06c8ab", "#06dcab", "#06f0ab"
    ],
    progress: ["#1089E7", "#F57474", "#56D0E3", "#F8B448", "#8B78F6"],
    line1: {
      play: "#0184d5",
      forward: "#00d887"
    },
    pie1: [
      "#006cff", "#60cda0", "#ed8884", "#ff9f7f",
      "#0096ff", "#9fe6b8", "#32c5e9", "#1d9dff"
    ]
  };

  // 当前筛选的年份
  let currentYear = "2019";

  return {
    industryData,
    monthlyData,
    ageData,
    learningData,
    mediaData,
    regionData,
    colors,
    getCurrentYear: function() {
      return currentYear;
    },
    setCurrentYear: function(year) {
      currentYear = year;
      // 发布年份变更事件
      EventBus.emit("yearChanged", year);
    }
  };
})();
